﻿using dsf.scenery.order.finance.MongoHelper;
using MongoDB.Bson;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuestionInvestig.MongoHelper

{
    public class UserAccess
    {
        private static readonly Mongo mongoHepler = new Mongo();
        //测试
        public void Insert()
        {
            User u = new User();
            u.Name = "cesfffsss";
            u.age = 67;
            var documents = MongoHelpe.GetBsonDocument(JsonConvert.SerializeObject(u));
            //mongoHepler.Insert(documents, MongoDbManager.Coll_User);
        }

        public void Find()
        {
            //User u = new User();
            //var s = mongoHepler.Find(MongoDbManager.Coll_User);
            //var bb = s["Name"];
        }
    }

    public class User
    {
        public string Name { get; set; }

        public int age { get; set; }
    }
}
